package com.bwie.controller;


import com.bwie.bean.Sysuser;
import com.bwie.service.HouseService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@Controller
public class DlController {

    @Resource
    private HouseService houseService;

    @RequestMapping("login.do")
    public String login(Sysuser sysuser, HttpSession session){
        //登录
       Sysuser s= houseService.login(sysuser);
       if (s!=null){
           session.setAttribute("sysuser",sysuser);
           return "redirect:list.do";
       }else{
           return "redirect:index.jsp";
       }
    }
}















